package com.blockmeta.bbs.businesslibrary.widget.scale;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.animation.Animation;

import razerdp.basepopup.BasePopupWindow;

/**
 * Created by author on 2018/5/18.
 * 创建一个Scale动画的Popup基类
 * 只负责动画
 * UI 以及点击时间交给子类去做处理
 *
 */
public abstract class BaseScalePopupWindow extends BasePopupWindow {


    public View popupView;

    public BaseScalePopupWindow(Activity context) {
        super(context);
        bindEvent();
    }

    @Override
    protected Animation initShowAnimation() {
        return getDefaultScaleAnimation();
    }

    @Override
    protected Animation initExitAnimation() {
        return getDefaultScaleAnimation(false);
    }

    @Override
    public View onCreatePopupView() {
        popupView = LayoutInflater.from(getContext()).inflate(getResId(), null);
        return popupView;
    }

    public  abstract int getResId();

    protected abstract void bindEvent();


}
